#include "signIn.hpp"
#include "mainWindow.hpp"

signIn::signIn(QWidget *)
{
	setWindowTitle("Armessenger");

	si 	 = new QPushButton("Sign In");
	layout	 = new QVBoxLayout;
	yourName = new QLineEdit;
	typeName = new QLabel("Your nick name");
	typeName->setAlignment(Qt::AlignCenter);

	layout->addWidget(typeName);
	layout->addWidget(yourName);
	layout->addWidget(si);
	setLayout(layout);	

	connect(yourName, SIGNAL(returnPressed()), si, SIGNAL(clicked()));
	connect(si, SIGNAL(clicked()), this, SLOT(createMain()));
	connect(si, SIGNAL(clicked()), this, SLOT(hide()));
}

void signIn::createMain()
{
	w = new mainWindow(0,yourName->text());
	w->show();
}
